<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://unpkg.com/vue@next"></script>
</head>

<body>
    <div id="app"></div>
</body>
<script>
    const app = Vue.createApp({//application 创建一个Vue应用
        data() {
            return {
                message: 'bilibili',
                classString: 'red',
                classObj: { red: true, brckground: true },
                classList: ['green', 'brckground', { red: true }],
                styleString:'color:red',
                styleObj:{
                    color:'red',
                    background:'green'
                }
            }
        },
        template: `
            <h2 :style="styleObj">{{message}}</h2>
            <sonCom class="green"/>
        `
    })
    app.component('sonCom',{    
        template:`
        <div>
            <div >sonCom</div>    
        </div>
        `
    })
    const vm = app.mount("#app")//挂载这个Vue应用
</script>
<style>
    .red {
        color: red !important;
    }

    .green {
        color: green;
    }

    .brckground {
        background: orange;
    }
</style>

</html>